import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:easy_go/pages/detail/detail_controller.dart';
import 'package:easy_go/pages/home/home_controller.dart';
import 'package:easy_go/pages/detail/widget/top_card_widget.dart';
import 'package:easy_go/pages/detail/widget/bottom_card_widget.dart';

class DetailPage extends GetView<DetailController> {
  const DetailPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('detail page')),
      body: SingleChildScrollView(
        child: Container(
          width: 400,
          height: MediaQuery.of(context).size.height,
            padding: const EdgeInsets.all(32),
            child: GetX<DetailController>(
              builder: (_) {
                _.post = Get.find<HomeController>().post;
                return ListView(
                  children: <Widget>[
                    Container(
                      color: Colors.lightBlue,
                      child: Column(
                        children: [
                          SizedBox(height: 150, width: 400, child: CardTopCustomWidget(model: _.post)),
                          SizedBox(height: 300, width: 400, child: CardBottomCustomWidget(model: _.post)),
                        ],
                      ),
                    )
                  ],
                );
              },
            )),
        ),
    );
  }
}